//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.vere.orm.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class CDate {
    public CDate() {
    }

    public static Calendar formatDateTime(String str) {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        Date date = null;
        Calendar cal = Calendar.getInstance();

        try {
            date = df.parse(str);
            cal.setTime(date);
        } catch (ParseException var5) {
            var5.printStackTrace();
        }

        return cal;
    }

    public static String getLogTime() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        Calendar cal = Calendar.getInstance();
        return df.format(cal.getTime());
    }

    public static String getCurrentDate() {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        Calendar cal = Calendar.getInstance();
        return df.format(cal.getTime());
    }

    public static String parseDateTime(Calendar cal) {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        String date = "";

        try {
            date = df.format(cal.getTime());
        } catch (Exception var4) {
            var4.printStackTrace();
        }

        return date;
    }

    public static String parseDateTime(Date date) {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        String str = "";

        try {
            str = df.format(date);
        } catch (Exception var4) {
            var4.printStackTrace();
        }

        return str;
    }
}
